package com.dingding.entity;

import com.dingding.enums.ResponseCode;
import lombok.Data;

@Data
public class BasePageResponse<T> {
    private String code;
    private String message = "";
    private T data;
    /**
     * 总页数
     */
    private long totalPage;
    /**
     * 当前页
     */
    private long currentPage;
    /**
     * 总条数
     */
    private long totalNum;

    public BasePageResponse() {
    }

    public BasePageResponse(ResponseCode code) {
        this.code = code.getCode();
//        this.message = code.getMessage();
    }

    public BasePageResponse(ResponseCode code, String message) {
        this.code = code.getCode();
//        this.message = message;
    }

    public BasePageResponse(ResponseCode code, T data) {
        this.code = code.getCode();
//        this.message = code.getMessage();
        this.data = data;
    }

    public void setCode(ResponseCode code) {
        this.code = code.getCode();
    }
}
